package com.kotlin.jetpack.android.jssdk.jsobj;

import com.google.gson.Gson;
import com.kotlin.jetpack.android.jssdk.bean.BaseModelBean;
import com.kotlin.jetpack.android.jssdk.bean.WhetherLoginBean;

import static com.kotlin.android.ktx.ext.LoginStateExtKt.isLogin;

/**
 * Created by zl on 17/6/19.
 * wanda 设置用户信息
 */

public class JSWhetherLoginObj {

	public String getWhetherLogin() {
		WhetherLoginBean loginBean = new WhetherLoginBean();
//		UserInfo userInfo = VariableExt.INSTANCE.getUserInfo();
//		String uId = "";
//		if (userInfo != null) {
//			uId = userInfo.getUid();
//		}
//		loginBean.setLoginToken(getSpValue(HeaderKey.TOKEN,""));
		loginBean.setAction(isLogin() ? "login" : "logout");

		BaseModelBean model = new BaseModelBean();
		Gson gson = new Gson();
		model.setErrMsg("");
		model.setSuccess(true);
		model.setData(loginBean);
		return gson.toJson(model);
	}

}
